#include <stdio.h>
#include <fcntl.h>  
#include "Apisockcomm.h"
#define WORD "i am the king of world!"
void main()
{
	int new_fd;
	int sd = SendOpen("127.0.0.1", 20000);

	FRAME frame;
	memset(&frame, 0x00, sizeof(frame));
	frame.pBuf = (unsigned char*)malloc(4096);
	strcpy(frame.pBuf, WORD);
	frame.frameSize = strlen(WORD);
	int			flags;
	flags = fcntl(new_fd, F_GETFL, 0);
	fcntl(sd, F_SETFL, flags | O_NONBLOCK);
	int ret = 0;
	int i =0;
	do{
		ret = SendApi_nonb_1(sd, &frame);
		printf("step %d ret : %d\n", i++, ret);
		sleep(1);
	}while(ret);
}
